package com.zyw;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(exclude = org.activiti.spring.boot.SecurityAutoConfiguration.class)
public class WorkflowaApplication {
	private final static Logger logger = LoggerFactory.getLogger(WorkflowaApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(WorkflowaApplication.class, args);
	}

	//配置一个命令行，在项目启动的时候会执行
	//在这里我们设置了全局的变量，当需要的时候根据${variableName}的方式来获取这些变量
	/*@Bean
	CommandLineRunner init(final RepositoryService repositoryService,
						   final RuntimeService runtimeService,
						   final TaskService taskService) {
		return new CommandLineRunner() {

			public void run(String... strings) throws Exception {
				Map<String, Object> variables = new HashMap<String, Object>();
				variables.put("applicantName", "John Doe");
				variables.put("email", "john.doe@activiti.com");
				variables.put("phoneNumber", "123456789");
				try {
					runtimeService.startProcessInstanceByKey("hireProcess", variables);
				}catch (Exception e){
					logger.error("CommandLineRunner init error");
				}
			}
		};
	}*/
}